import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/index'
import Login from '../views/Login'
import NotFound from '../views/NotFound/404'
import UserList from '../components/content/User/operationUser/userList'
import ResetUser from '../components/content/User/operationUser/resetUser'
import Profile from '../components/content/User/addUser/profile'
import test from '../components/content/Context/Products/product'
import ProductProfile from '../components/content/Context/Products/productProfile'
import ResetProduct from '../components/content/Context/Products/resetProduct'
import ueditor_demo from '../components/content/Context/UpProducts/ueditor_demo'
import Suggestion from '../components/content/Suggestion/suggestion'
import ResetCode from '../components/content/Setting/resetCode'
Vue.use(VueRouter)
export default new VueRouter({
  routes: [
    {path: '/',component: Login},
    {path: '/main/:name',component: index,alwaysShow: true,props: true,meta:{requireAuth:true},
      children:[
      {path: '/user/profile' ,component:Profile,meta:{requireAuth:true}},
        {path:'/user/userList',component: UserList,meta:{requireAuth:true}},
        {path:'/content/UEditor',component:ueditor_demo,meta:{requireAuth:true}},
        {path:'/content/product',component:test,meta:{requireAuth:true}},
        {path:'/content/suggestion',component:Suggestion,meta:{requireAuth:true}},
        {path:'/content/reset',component:ResetCode,meta:{requireAuth:true}},
        {path:'/content/productProfile/:id',component:ProductProfile,props: true,meta:{requireAuth:true}},
        {path:'/content/resetUser/:sid',component:ResetUser,props: true,meta:{requireAuth:true}},
        {path:'/content/resetProduct/:pid',component:ResetProduct,props: true,meta:{requireAuth:true}},
      ]
    },
    {path: '/login',component: Login},
    {path: '/*',component:NotFound},
  ]
})
